<?php
// 这是系统自动生成的公共文件

//题目类型
if(!function_exists("topicType")) {
    function topicType($typeid)
    {
        $msg = "单选题";
        switch ($typeid) {
            case 1:
                $msg = "多选题";
                break;
            case 2:
                $msg = "问答题";
                break;
            case 3:
                $msg = "论文题";
                break;
        }
        return $msg;
    }
}


//课程类型
if(!function_exists("courseType")) {
    function courseType($typeid)
    {
        $msg = "初级";
        switch ($typeid) {
            case 1:
                $msg = "中级";
                break;
            case 2:
                $msg = "高级";
                break;
        }
        return $msg;
    }
}


//文章类型
if(!function_exists("articleType")) {
    function articleType($typeid)
    {
        $msg = "考试动态";
        switch ($typeid) {
            case 2:
                $msg = "常见问题";
                break;
        }
        return $msg;
    }
}

//选项转换
if(!function_exists("optionIndexChange")) {
    function optionIndexChange($typeid)
    {
        $msg = "A";
        switch ($typeid) {
            case 1:
                $msg = "B";
                break;
            case 2:
                $msg = "C";
                break;
            case 3:
                $msg = "D";
                break;
            case 4:
                $msg = "E";
                break;
        }
        return $msg;
    }
}


if(!function_exists("msubstr")) {
    function msubstr($str,$length)
    {
       return mb_strlen($str)>$length?mb_substr($str,0,$length,"utf-8")."...":$str;
    }
}
